package cn.doitedu.api;

import org.apache.flink.streaming.api.datastream.DataStreamSource;
import org.apache.flink.streaming.api.environment.StreamExecutionEnvironment;

public class _07_MyJdbcSourceFunction_Test {

    public static void main(String[] args) throws Exception {


        StreamExecutionEnvironment env = StreamExecutionEnvironment.getExecutionEnvironment();
        env.setParallelism(1);


        // 构造我们自己定义的jdbc source

        _07_MyJdbcSourceFunction source = _07_MyJdbcSourceFunction.builder()
                .setDbName("doit46")
                .setTableName("student")
                .setJdbcUrl("jdbc:mysql://doitedu:3306/")
                .setDbUserName("root")
                .setDbPassword("root")
                .build();

        DataStreamSource<String> stream = env.addSource(source, "new_bee-source");

        stream.print();


        env.execute();


    }

}
